Cambiamenti: News e Consigli per la Sostenibilità | Hera Comm
In Evidenza
Scegli l’ambito di tuo interesse
Si è verificato un errore nell'elaborarazione del modello.
Can't convert this string to number: ""
The blamed expression:
==> jsonLink.getString("groupId")?number [in template "20099#20135#1138330" at line 47, column 39]
----
FTL stack trace ("~" means nesting-related):
- Failed at: groupId = jsonLink.getString("groupId... [in template "20099#20135#1138330" at line 47, column 29]
----
1<section>
2 <#assign key = "portletSetupTitle_" + locale.toString()
3 titleDisplay = (portletPreferences[key]??)?then(portletPreferences[key][0], "")/>
4
5 <#if entries?has_content>
6 <div class="card">
7 <div class="card__exteranalWrapper">
8 <#assign urlFromCategory = "" linkCategory = "#" />
9 <#assign
10 heraVocabulary= heraContributorLocalService.getGroupVocabulary(themeDisplay.getScopeGroupId(),"Hera Landing Cambiamenti")
11 />
12 <#list entries as entry>
13 <#list entry.getCategories() as category>
14 <#if heraVocabulary.getCategories()?seq_contains(category)>
15 <#assign
16 AssetCategories = heraContributorLocalService.getCategoryProperty(category.getCategoryId(),"key").getValue()
17 urlFromCategory = heraTemplateCustomService.getCategory(AssetCategories)
18 linkCategory = '/cambiamenti/' + urlFromCategory />
19 </#if>
20 </#list>
21 </#list>
22
23 <#assign
24 article= heraContributorLocalService.fetchArticleByUrlTitle(themeDisplay.getScopeGroupId(), urlFromCategory)!""
25 titoloAsset = ""
26 />
27
28 <div class="card__titleWrapper">
29 <h3 class="card__title">${titleDisplay}</h3> | <a class="ml-2 black btn-cta" href="${linkCategory}">Vedi tutto <i class="icon-arrow-r darkish-color align-sub ml-1"></i></a>
30 </div>
31 <div class="card__allCardscontainer">
32
33 <#list entries as curEntry>
34 <#assign
35 assetRenderer = curEntry.getAssetRenderer()
36 articoloUrl = curEntry.getAssetRenderer().getArticle().getUrlTitle()
37 docXml = saxReaderUtil.read(curEntry.getAssetRenderer().getArticle().getContentByLocale(locale.toString()))
38 linkFromXml = docXml.valueOf("//dynamic-element[@name='CTADettaglioArticolo']/dynamic-content/text()")
39 titolo = docXml.valueOf("//dynamic-element[@name='Titolo']/dynamic-content/text()")
40 immagineSoIn = docXml.valueOf("//dynamic-element[@name='ImmagineCard']/dynamic-content/text()")
41 />
42
43 <#-- Verifica che linkFromXml non sia vuoto prima di usarlo -->
44 <#if linkFromXml?has_content>
45 <#assign jsonLink = jsonFactoryUtil.createJSONObject(linkFromXml) />
46 <#assign
47 groupId = jsonLink.getString("groupId")?number
48 layoutId = jsonLink.getString("layoutId")?number
49 privateLayout = jsonLink.getBoolean("privateLayout")
50 pageLayout = heraContributorLocalService.getLayout(groupId, privateLayout, layoutId)
51 ctaURL = pageLayout.getFriendlyURL()
52 />
53 <#else>
54 <#assign ctaURL = "#" />
55 </#if>
56
57 <#list "${immagineSoIn}"?split(",") as imageTmpSingleVar>
58 <#assign
59 imageSingleVar = imageTmpSingleVar?split(":")
60 />
61 <#if imageSingleVar[0]?contains("groupId")>
62 <#assign
63 immagineStrGroupID = imageSingleVar[1]?replace('"', '')
64 />
65 <#elseif imageSingleVar[0]?contains("name")>
66 <#assign
67 immagineStrName = imageSingleVar[1]?replace('"', '')
68 immagineStrName = immagineStrName?replace(' ', '+')
69 />
70 <#elseif imageSingleVar[0]?contains("uuid")>
71 <#assign
72 immagineStrUUID = imageSingleVar[1]?replace('"', '')
73 />
74 </#if>
75 </#list>
76
77 <#assign
78 immagineUrl = ""
79 />
80 <#if immagineStrGroupID?? && immagineStrName?? && immagineStrUUID??>
81 <#assign
82 immagineUrl = "/documents/" + immagineStrGroupID + "/0/" + immagineStrName + "/" + immagineStrUUID
83 />
84 </#if>
85
86 <a class="card__wrapper" href="${ctaURL}" >
87 <div class="card__internalWrapper">
88 <img style="aspect-ratio: 1.53;" loading="lazy" src="${immagineUrl}" alt="card" class="card__img">
89 <div class="card__details">
90 <#list curEntry.getTags() as tag>
91 <span class="card__tag">
92 ${tag.name}
93 </span>
94 </#list>
95 <p class="card__description">${titolo}</p>
96 </div>
97 </div>
98 </a>
99 </#list>
100 </div>
101 </div>
102 </div>
103 </#if>
104</section>
